/*
 *  (c) 2010-2012 Ashwin Rayaprolu (http://linkwithweb.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
 *  file except in compliance with the License. You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the
 *  License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 *  either express or implied. See the License for the specific language governing permissions
 *  and limitations under the License.
 */
 


/**
 * Top level Abstract class for All design Components. All components have to
 * extend this
 */
SwiftUI.FormManager = function(options) {
	this.initialize(options);
};

SwiftUI.FormManager.prototype = {
		
/**
 * @class Implements drag-n-drop manager -- a group of linked draggables and
 *        drop zones
 * @constructs
 */
   initialize: function(options) {
      this.formElementMap = {};
      
      /**
		 * Assign default data loading services url
		 */
      this.options={
          layout  : "VERTICAL",
          name  : "",
          id    : "",
          icon  : "",
          htmlElementText : "",
          componentType : "",
          
          colSpan : 1,
          rowSpan : 1,
          
          isContainer : false,
          // To store components present location on the container.
          width : -1,
          height : -1
    	  
      };
      
      SwiftUI.extend(this.options, options || {});
      
      
   },
   
	addFormElement:function(position,element){
		this.formElementMap.position = element;
	},
	
	realignForm :function(layout){
		
	}
	
   
};


/**
 * Text box component
 */
SwiftUI.TextBoxComponent = function(textBoxId) {
	  this.init(textBoxId);
};

SwiftUI.TextBoxComponent.prototype =  {

	init:function(textBoxId){
	      /**
			 * Assign default data loading services url
			 */
	      this.options = {  
	          text  : this.textBoxId,
	          name  : this.textBoxId,
	          id    : this.textBoxId,
	          icon  : "",
	          htmlElementText : "<input type='text' id='' name=''></input>",
	          componentType : SwiftUI.UIDesignComponent.ComponentTypes.TextBox
	      };
	      
	      SwiftUI.extend(this,new SwiftUI.UIDesignComponent(this.options));
	      
	}
};
// Create a democomponent so that
new SwiftUI.TextBoxComponent("SwiftUI_DemoComponent");




SwiftUI.includeLoaded('SwiftUIDesignComponent.js');